Skip to content

sandbox,server: surface per-path L7 escalations as fresh draft chunks#1

Open
dkaygithub wants to merge 1 commit into
mainfrom
l7-per-path-escalations
Open

sandbox,server: surface per-path L7 escalations as fresh draft chunks#1
dkaygithub wants to merge 1 commit into
mainfrom
l7-per-path-escalations

Conversation

@dkaygithub

Copy link
Copy Markdown
Owner

Summary

Post-approval L7 (HTTP method/path) denials were vanishing instead of reaching a reviewer. This surfaces them as fresh, reviewable draft chunks while suppressing straggler-flush noise.

  • sandbox: L7 relay denials now feed the denial aggregator (denial_tx on L7EvalContext) carrying the observed method/path, so mechanistic proposals are path-aware — same observation-driven path as connect-stage denials.
  • persistence: clear dedup_key on chunk decision (sqlite + postgres) and backfill already-decided rows via migration 006. Post-decision denials form a fresh pending chunk instead of silently folding their hit_count into a row the reviewer already acted on.
  • server: the post-approval mechanistic self-reject sweep is L7-evidence-aware — a resubmit asking ⊆ the union of approved grants for the endpoint still self-rejects; an ask outside the grant stays pending. Coverage uses a conservative glob matcher (* = one segment, ** trailing only, unknown shapes → exact equality).
  • server: the sweep is gated on a live-policy probe (policy_covers_rule) so an expired temporary grant / removed clause doesn't auto-reject every future denial and leave the endpoint permanently un-reviewable.

Test plan

  • cargo test -p openshell-supervisor-network — 300 L7 tests + l7_deny_emits_denial_event_with_method_and_path pass
  • cargo test -p openshell-servermechanistic_* (incl. ghost-approval/rule-removal) + l7_path_covers_glob_semantics, 7 tests pass
  • Both crates cargo check clean against current upstream/main

Notes

Staging PR within the fork (base dkaygithub:main, freshly mirrored to upstream). Not for upstream submission yet. Three original commits (40455dd8, 8c5c19c2, cc7a01d3) squashed into one and rebased onto upstream PR NVIDIA#1650's crate split (openshell-sandboxopenshell-supervisor-network).

🤖 Generated with Claude Code

@dkaygithub dkaygithub force-pushed the l7-per-path-escalations branch from e0d40de to 0680295 Compare June 17, 2026 01:35
Post-approval L7 (HTTP method/path) denials were vanishing instead of
reaching a reviewer. Wire them through to a fresh, reviewable draft chunk
while keeping straggler-flush noise suppressed.

- sandbox: wire L7 relay denials into the denial aggregator. L7EvalContext
  gains a denial_tx channel; every L7 deny (request-log and forward paths)
  emits a DenialEvent carrying the observed method/path, feeding the same
  observation-driven analysis as connect-stage denials so mechanistic
  proposals can be path-aware.

- server persistence: clear dedup_key when a chunk is decided (sqlite +
  postgres). New observations for the same host|port|binary then surface as
  a fresh pending chunk instead of folding their hit_count, through the
  status-blind submit upsert, into a row the reviewer already acted on.

- server: make the post-approval mechanistic self-reject sweep
  L7-evidence-aware. A resubmit asking for nothing beyond the union of the
  approved grants for that endpoint still self-rejects (noise suppression);
  a submission carrying method/path asks OUTSIDE the approved grants stays
  pending for review. Path coverage uses a conservative glob matcher
  (* = one segment, ** trailing only, unknown shapes fall back to exact
  equality) so ambiguity errs toward surfacing a card.

- server: gate the self-reject sweep on a live-policy probe
  (policy_covers_rule). Approved chunk records outlive the clauses they
  merged (a temporary grant expiring via RemoveBinary, or a manual
  --remove-rule); trusting the record alone would auto-reject every future
  denial for that endpoint, leaving it permanently un-reviewable.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dkaygithub dkaygithub force-pushed the l7-per-path-escalations branch from 0680295 to e13242a Compare June 17, 2026 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant